#pragma once
#include "../core.h"
namespace qb{
	namespace base{
		namespace sp{
			class SStringBlock;
			class SStringBlockList;
		}
		class HeapAllocator;
		class S_CORE_EXPORT StringPage {			// 
		public:
			typedef char Element;
			typedef const Element* ConstElementPtr;
			typedef sp::SStringBlock SStringBlock;
			typedef sp::SStringBlockList SStringBlockList;
			enum {
				MAGIC = 0xABCD
			};
		protected:
			int						m_block_size;	// 应该给SStringBlock分配的内存大小
			SStringBlockList* m_block_list;	// 
			HeapAllocator* m_heap;
		public:
			StringPage();
			~StringPage();
			void Reset();
			void Clear();
			ConstElementPtr AddString(ConstElementPtr str, int len);
			int GetBytes();
			void DumpStatus();
		};

	}
}
